package com.study.d004;

import javafx.application.Application;
import javafx.stage.Modality;
import javafx.stage.Stage;

/**
 * 模态框和非模态框
 *	--Modality.APPLICATION_MODAL : 模态框，只有先关闭当前窗口，才能操作其他窗口
 *	--Modality.NONE				 : 非模态框
 *	--Modality.WINDOW_MODAL      : 该模式下，要想实现模态框，需要设置initOwner(s1)，即需要设置父容器才行
 */
public class ModelStage extends Application{
	public static void main(String[] args) {
		launch(args);
	}
	@Override
	public void start(Stage primaryStage) throws Exception {
		Stage s1  =new Stage();
		s1.setTitle("s1");
		s1.show();

		Stage s2  =new Stage();
		s2.setTitle("s2");
		s2.initOwner(s1);
		s2.initModality(Modality.WINDOW_MODAL);
		s2.show();


		Stage s3  =new Stage();
		//s3.initModality(Modality.NONE);
		s3.setTitle("s3");
		s3.show();

	}
}
